<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:um="http://java.sun.com/jsf/composite/components/um"
	template="templates/masterLayout.xhtml">
	<f:loadBundle basename="usermanagement.MessageResources" var="message" />
	<ui:define name="title">${message.addUser}</ui:define>
	<ui:define name="content">
		<f:view>
			<h:form id="addUser">
				<rich:panel header="Add user" style="width: 315px">
					<h:panelGrid columns="2">
						<h:outputText value="#{message.username}" styleClass="required" />
						<h:inputText value="#{registerBean.user.username}" id="username">
							<f:validateLength minimum="5" />
							<f:ajax immediate="true" render="errorMessages" />
						</h:inputText>
						<h:outputText value="#{message.email}" styleClass="required" />
						<h:inputText value="#{registerBean.user.email}" id="email">
							<f:validator validatorId="emailValidator" />
							<f:ajax immediate="true" render="errorMessages" />
						</h:inputText>
						<h:outputText value="#{message.password}" styleClass="required" />
						<h:inputSecret value="#{registerBean.user.password}" id="password" />
					</h:panelGrid>
					<h:commandButton action="#{registerBean.register}"
						value="#{message.addUser}" id="addUser" />
					<h:commandLink action="logout" id="logout"
						value="#{message.logout}" />
				</rich:panel>
				<h:messages id="errorMessages" />
			</h:form>
		</f:view>
	</ui:define>
</ui:composition>
